As described in Operational Methods Overview, OPC operations are much more effective if performed together - multiple operations at once. Multiple-operation methods allow you to perform such simultaneous operations, and you should use whenever possible, over single-operation methods.
By convention, multiple-operation methods always contain the word "Multiple" in their name.
In its basic form, the multiple-operation method takes an array (of multiple arrays) of arguments as an input, and produces (as an output) a return value which is an array of results.
The size of the output array is the same as the size of the input array(s), and an element at each index in the result array contains a result that corresponds to the arguments at the same index in the input array(s).
Some COM tools and languages (e.g. PowerScript in PowerBuilder) lack the ability to properly provide or process arrays of COM objects. In such case, using multiple-operation methods would be impossible using their standard array-based form.
In order to make the use of multiple-operations methods in such tools and language possible, OPC Data Client introduces an alternative form of these methods, where arrays are replaced by lists (objects). You can then use methods and properties on the list object in order to access its element, instead of indexing an array. By convention, the list-based methods always contain the word "List" in their name. For correspondence between the array-based and list-based methods, see Operational Methods Overview. Of course, if you prefer, you can use the list-based methods from other tools and languages as well.
The order of elements in the return value corresponds with the order of elements in the method arguments. List elements can also be accessed by index, and therefore an element of the returned list corresponds at certain index corresponds to the element of the arguments list at the same index.
A list object that is passed to a list-based multiple-operation method can be any object that implement the IList Interface. A list object returned from the method also derived from the same interface; in fact, it may provide even broader guarantees as to what interfaces are supported.
You will typically use following members of the list object in order to meaningfully create the list and acess its elements:
In principle, a list can also be enumerated using standard COM collection enumeration approach, although various COM tools and languages also fail implementing it properly. You can, however, use a standard "for" loop, available in practically all languages, with an integer counter, and access the list's element by index. List indexes are zero-based, i.e. the range of valid indexes (for already existing elements of the list) is between 0 and (Count - 1).
OPC Data Client provides an ElasticVector Class, which you can conveniently use to provide list-based arguments to multiple-operation methods. The ElasticVector implements the IList Interface, and has a handful of additional useful members as well.
Above that, it is truly "elastic", in the sense that it can grow automatically with certain operations. It does not shrink by itself. The growing constitutes of lowering the lower bound or increasing the upper bound as necessary for the operation. The absolute element indexes remain unchanged, even when the lower bound changes.
Setting an element at specified index is, for example, always a valid operation with the ElasticVector, regardless of whether the index falls between the current lower and upper bounds of the vector. If it falls outside the range, the bounds are automatically adjusted as needed. This allows the object be used without having to explicitly set the vector dimensions first.
Following examples shows usage of the ElasticVector Class for passing a list of arguments into a multiple-operation method. The example also shows how the return value from the multiple-operation method, which is a list again, can be processed and its elements extracted.